package com.nce.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import org.springside.modules.orm.Page;
import org.springside.modules.orm.PropertyFilter;

import com.nce.dao.WordsDao;
import com.nce.entity.Words;

@Component
@Transactional
public class WordsService {
	@Autowired
	private WordsDao wordsDao;

	public WordsDao getWordsDao() {
		return wordsDao;
	}

	public void setWordsDao(WordsDao wordsDao) {
		this.wordsDao = wordsDao;
	}

	public Words getWords(Long id) {
		return wordsDao.get(id);
	}

	public Page<Words> findWords(Page<Words> page, List<PropertyFilter> filters) {
		return wordsDao.findPage(page, filters);
	}

	public void saveWords(Words entity) {
		wordsDao.save(entity);
		
	}

	public  void deleteWords(Long id) {
		wordsDao.delete(id);
		
	}
	
	public List<Words> getAllWords(){
		return wordsDao.getAll();
	}

	
	
}
